import useRequest from '@/utils/request'

const request = useRequest({})
// 查询参数列表
export function listConfig(query: any) {
  return request.get('/system/config/list', {
    params: query,
  })
}

// 查询参数详细
export function getConfig(configId: string) {
  return request.get('/system/config/' + configId)
}

// 根据参数键名查询参数值
export function getConfigKey(configKey: string) {
  return request.get('/system/config/configKey/' + configKey)
}

// 新增参数配置
export function addConfig(data: any) {
  return request.post('/system/config', data)
}

// 修改参数配置
export function updateConfig(data: any) {
  return request.put('/system/config', data)
}

// 删除参数配置
export function delConfig(configId: string) {
  return request.delete('/system/config/' + configId)
}

// 刷新参数缓存
export function refreshCache() {
  return request.delete('/system/config/refreshCache')
}
